//
//  SYDTravelTrackBottonView.m
//  PinGJByOwnerSide
//
//  Created by lantaiyuan on 2017/8/15.
//  Copyright © 2017年 lantaiyuan. All rights reserved.
//

#import "SYDTravelTrackBottonView.h"
@interface SYDTravelTrackBottonView()
@property (weak, nonatomic) IBOutlet UIView *trackOneView;//状态1
@property (weak, nonatomic) IBOutlet UIView *trackTwoView;//状态2
@property (weak, nonatomic) IBOutlet UILabel *startLocation;//起点
@property (weak, nonatomic) IBOutlet UILabel *endStationLbl;//终点
@property (weak, nonatomic) IBOutlet UILabel *distanceLbl;//行程
@property (weak, nonatomic) IBOutlet UILabel *spendTimeLbl;//花费时间
@property (weak, nonatomic) IBOutlet UILabel *numberLbl;//人数
@property (weak, nonatomic) IBOutlet UILabel *revenueLbl;//收入

@end

@implementation SYDTravelTrackBottonView

- (instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        self = [[NSBundle mainBundle]loadNibNamed:NSStringFromClass([SYDTravelTrackBottonView class]) owner:nil options:nil].lastObject;
        self.frame = frame;
    }
    return self;
}

-(void)awakeFromNib{
    [super awakeFromNib];
}

- (void)setModel:(YMTravelTrack *)model{
    _startLocation.text = model.firstStationName;
    _endStationLbl.text = model.lastStationName;
    _distanceLbl.text = [NSString stringWithFormat:@"%.2f",[model.totalDistance integerValue] / 1000.0];
    _spendTimeLbl.text = [NSString stringWithFormat:@"%.2f", [model.totalTimeConsuming integerValue] / 3600.0];
    _numberLbl.text = [NSString stringWithFormat:@"%ld", [model.totalCount integerValue]];
    _revenueLbl.text = [NSString stringWithFormat:@"%.2f", [model.totalIncome floatValue]];
}

@end
